﻿using NServiceBus;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Nservice.Billing.Server.Service
{
    public class CreditService: ICreditService,INeedInitialization
    {

        public void ChargedCredit(Guid OrderId, double Amount)
        {
            Console.WriteLine("The order has been charged to the BDO with Order ID: {0}, and Amount of {1}",OrderId, Amount );
        }

        public void Customize(BusConfiguration configuration)
        {
            configuration.RegisterComponents(c => c.ConfigureComponent<CreditService>(DependencyLifecycle.SingleInstance));
        }
    }

    public interface ICreditService {
        void ChargedCredit(Guid OrderId, double Amount);
    }
}
